import { DashboardOne, DocDetail, ImageFiles } from '@icon-park/vue-next'
import { RouteRecordRaw } from 'vue-router'

export default [
  {
    path: '/',
    redirect: "/admin"
  },
  {
    path: '/admin',
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '工作台', icon: DashboardOne, order: 100 }, permission: 'user' },
    children: [
      {
        name: 'admin',
        path: '',
        component: () => import('@/views/admin/index.vue'),
        meta: { title: '工作台', menu: { title: '工作台' }, permission: 'user' },
      },
    ],
  },
  {
    path: '/admin/business',
    component: () => import('@/layouts/admin/index.vue'),
    meta: { auth: true, menu: { title: '业务管理', icon: DocDetail }, permission: 'user' },
    children: [
      {
        name: 'busniess',
        path: '',
        component: () => import('@/views/admin/business.vue'),
        meta: { title: '提交业务', menu: { title: '提交业务' }, permission: 'user' },
      },
      {
        name: 'my',
        path: 'my',
        component: () => import('@/views/admin/my.vue'),
        meta: { title: '业务数据', menu: { title: '业务数据' }, permission: 'user' },
      },
    ],
  },
  {
    path: '/admin/system',
    component: () => import('@/layouts/admin/index.vue'),
    meta: {
      auth: true,
      menu: { title: '系统管理', icon: ImageFiles },
      permission: 'master'
    },
    children: [
      {
        name: 'system',
        path: 'system',
        component: () => import('@/views/admin/system.vue'),
        meta: { title: '部门&员工', menu: { title: '部门&员工' }, permission: 'master' },
      },
      {
        name: 'logs',
        path: 'logs',
        component: () => import('@/views/admin/logs.vue'),
        meta: { title: '日志管理', menu: { title: '日志管理' }, permission: 'master' },
      },
      {
        name: 'performance',
        path: 'performance',
        component: () => import('@/views/admin/performance.vue'),
        meta: { title: '业绩查询', menu: { title: '业绩查询' }, permission: 'master' },
      },
    ],
  },
] as RouteRecordRaw[]
